Refactor Microsoft JDK installer to fetch version information from Microsoft#928
Open
schdief wants to merge 1 commit intoactions:mainfrom
Open
Refactor Microsoft JDK installer to fetch version information from Microsoft#928schdief wants to merge 1 commit intoactions:mainfrom
schdief wants to merge 1 commit intoactions:mainfrom
Conversation
…crosoft Learn - Removed dependency on static JSON file for version info - Implemented HTML parsing to dynamically retrieve available JDK versions - Updated unit tests to reflect new version fetching method - Revised documentation to reflect changes in version retrieval and network requirements - Deleted outdated JSON file as it is no longer needed
Author
|
@mahabaleshwars @aparnajyothi-y @HarithaVattikuti Would appreciate attention to the many PRs (like this one) and Issues. I'd also like to contribute more actively to this Action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description:
Microsoft JDK Distribution Refactoring
Summary
The Microsoft JDK installer has been refactored to fetch version information directly from the official Microsoft Learn documentation page instead of using a static JSON file stored in the repository.
Problems Solved
microsoft-openjdk-versions.json) was outdated and didn't contain the latest Microsoft JDK releasesFiles Modified
1.
src/distributions/microsoft/installer.tsPurpose: Core implementation of Microsoft JDK version fetching and installation
Changes:
getGitHubHttpHeadersimport (no longer needed)TypedResponseimport (no longer needed)getAvailableVersions()method - now fetches from Microsoft Learn instead of GitHub APIparseVersionsFromHtml()method - extracts versions from HTML using regexgenerateDownloadFiles()method - dynamically creates download URLsBefore:
After:
Key Methods
getAvailableVersions()parseVersionsFromHtml(html: string)/OpenJDK\s+(\d+\.\d+\.\d+)(?:\s+LTS)?/gito find version numbersgenerateDownloadFiles(version: string, majorVersion: string)2.
__tests__/distributors/microsoft-installer.test.tsPurpose: Unit tests for Microsoft JDK installer
Changes:
data from '../data/microsoft.json'importgetJsonmethodgetmethod returning HTMLTest Version Updates:
3.
docs/advanced-usage.mdPurpose: User documentation for advanced usage scenarios
Changes:
tokeninput to increase rate limitslearn.microsoft.comandaka.msinstead ofgithub.com)Before:
After:
4. Files Deleted
src/distributions/microsoft/microsoft-openjdk-versions.jsonBenefits
Impact Analysis
Users
✅ No action required - Changes are transparent to users
✅ Better experience - Always get latest versions
✅ Fewer failures - No more rate limiting issues
Contributors
✅ Less maintenance - No need to update version JSON files
✅ Easier testing - Can test against live Microsoft releases
Operations
✅ Reduced GitHub API usage - No more API calls for version info
✅ Better reliability - Fetches from authoritative source
✅ Self-updating - New versions available immediately after Microsoft releases
Network Requirements Change
Before
api.github.com- To fetch version informationaka.ms- To download JDK binariesAfter
learn.microsoft.com- To fetch version informationaka.ms- To download JDK binariesBackward Compatibility
✅ 100% Compatible - Existing workflows continue to work unchanged
✅ Same API - No changes to action inputs or outputs
✅ Same behavior - Downloads and installs JDK the same way
✅ Better versions - Now includes latest releases that were missing before
Current Supported Versions (as of Oct 2025)
Based on the refactored implementation, the following versions are automatically detected:
Download URL Pattern
The download URLs follow Microsoft's standard pattern:
Where:
{version}: Version number (e.g., 21.0.8){os}: Operating system (linux, macos, windows){arch}: Architecture (x64, aarch64){ext}: File extension (tar.gz, zip)Example URLs
Testing
Running Tests
npm test -- microsoft-installer.test.tsTesting Checklist
Rollback Plan (If Needed)
If issues are discovered, rollback requires:
installer.tsgetAvailableVersions()methodmicrosoft-openjdk-versions.jsonfile with updated versionsNote: The old JSON file has been deleted. If needed, it can be retrieved from git history (commit before this refactoring).
Success Metrics
References
Related issue:

#645
Check list: